-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for starting a Live Activity with input-push-token on iOS 18 #1079
base: main
Are you sure you want to change the base?
Conversation
b3c0583
to
13af288
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, and thank you for the contribution! It's unclear to me why Apple has decided to model this as an integer; it seems like it's a boolean flag, right?
I think it probably makes sense to change the internal representation from a nullable Integer
to just a boolean
, then turn that into a 1
when we actually build the payload. Does that seem reasonable to you?
pushy/src/main/java/com/eatthepath/pushy/apns/util/ApnsPayloadBuilder.java
Outdated
Show resolved
Hide resolved
@@ -856,6 +858,19 @@ public ApnsPayloadBuilder setTimestamp(final Instant timestamp) { | |||
return this; | |||
} | |||
|
|||
/** | |||
* <p>Sets the flag to wake up the app and receive a push token to send updates to the started Live Activity.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple comments here:
- If this is a single paragraph, I don't think we need
<p>
tags. - While this isn't incorrect, I do think there's more of the story we can and should tell for callers. In particular: this is for establishing a new channel for live activities, and it's intended for iOS 18 and newer. If it's helpful to you, I'd be happy to suggest specific wording!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay! I have updated the Javadoc to provide a bit more info. If the changes are fine, otherwise I'm open for any suggestions. In general, I don't like rehashing info from the source (Apple docs in this case), since from the outside most of the time it feels like trying to documenting undocumented behavior.
Adds support for passing the
input-push-token
attribute, which is required in iOS 18 to start a Live Activity that wakes the app to get a push token to update the created Live Activity (which was not needed on iOS 17).This has been tested with iOS 18.0 beta 6.
Apple docs: https://developer.apple.com/documentation/activitykit/starting-and-updating-live-activities-with-activitykit-push-notifications